<!DOCTYPE html>
<html>
  <head>
    <title>解构</title>
    <style></style>
  </head>
  <body>
    <script>
      // 解构是浅拷贝
      const arr = [
        {
          a: 1,
        },
        {
          a: 2,
        },
        3,
      ]
      const objArr = [...arr]
      objArr[0].a = 4
      objArr[2] = 6
      console.log(objArr, arr)
    </script>
  </body>
</html>
